<!--信息安全-统计分析-涉敏操作管理违规情况统计表-->
<template>
  <div :class="isScroll?'rank-chest-table':''">
    <span class="table-title">涉敏操作管理违规情况统计表</span>
    <el-table border
              style="width: 100%"
              :data="tableData"
              :height="tableHeight">
      <el-table-column prop="rn"
                       label="排名"
                       width="50"
                       align="center"
                       :formatter="formatRn"></el-table-column>
      <el-table-column prop="prvdName"
                       label="公司"
                       align="center"
                       min-width="80"></el-table-column>
      <el-table-column prop="cityName"
                       label="地市/省部门"
                       align="center"
                       min-width="80"></el-table-column>
      <el-table-column prop="senRecordNum"
                       label="涉敏操作日志数量（条）E"
                       align="center"
                       min-width="80"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="illAccNum"
                       label="违规删改系统日志涉及的账号数量（个）"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="illRecordTime"
                       label="违规删改系统日志次数（次）"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatPer"></el-table-column>
      <el-table-column prop="illAccTotalNum"
                       label="违规进行管理员操作涉及的账号总数量（个）I=K+N"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="illAccTotalTime"
                       label="违规进行管理员操作的总次数（次）J=L+O"
                       align="center"
                       min-width="120"
                       :formatter="formatNum"
                       sortable></el-table-column>
      <el-table-column prop="facAccNum"
                       label="厂商人员违规进行管理员操作涉及的账号数量（个）K"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facRecordNum"
                       label="厂商人员违规进行管理员操作的日志数量（条）L"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facByAccNum"
                       label="厂商人员通过账号切换的方式使用管理员权限涉及的账号数量（个）N"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facByAccTime"
                       label="厂商人员通过账号切换的方式使用管理员权限的次数（次）O"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facIllAccNum"
                       label="厂商人员违规进行涉敏操作涉及的账号数量（个）"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facIllRecNum"
                       label="厂商人员违规进行涉敏操作的日志数量（条）S"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="facSenRecPer"
                       label="厂商人员违规进行涉敏操作的日志数量占比S/E%"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatPer"></el-table-column>
      <el-table-column prop="noPersonAccNum"
                       label="不在涉敏人员库中的人员违规进行涉敏操作涉及的账号数量（个）"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="noPersonRecNum"
                       label="不在涉敏人员库中的人员违规进行涉敏操作的日志数量（条）V"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatNum"></el-table-column>
      <el-table-column prop="noPersonRecPer"
                       label="不在涉敏人员库中的人员违规进行涉敏操作的日志数量占比V/E%"
                       align="center"
                       min-width="120"
                       sortable
                       :formatter="formatPer"></el-table-column>
    </el-table>
  </div>
</template>
<script>
import { mapState, mapActions, mapMutations } from "vuex";
import SubTableMixin from "@/components/SubjectPage/mixins/SubTable";
export default {
  name: "SenRankTab",
  mixins: [SubTableMixin],
  data() {
    return {
      // 表格数据
      tableData: null,
      clientWidth: document.body.clientWidth,
      isScroll: false
    };
  },
  computed: mapState({
    tableHeight: state => state.contentHeight - 316, // table内容高度
    prvdId: state => state.subject.prvdId, // 省公司id
    audTrm: state => state.subject.audTrm, // 审计月
    flagId: state => state.khxxaq.flagId // 域id
  }),
  watch: {
    prvdId(newVal, oldVal) {
      this.loadTableData();
    },
    audTrm(newVal, oldVal) {
      this.loadTableData();
    },
    concern(newVal, oldVal) {
      this.loadTableData();
    },
    flagId(newVal, oldVal) {
      this.loadTableData();
    }
  },
  created() {
    if (this.clientWidth === 1280) {
      this.isScroll = true;
    } else {
      this.isScroll = false;
    }
  },
  mounted() {
    this.loadTableData();
  },
  methods: {
    // 查询结果
    loadTableData() {
      // 获取表格数据
      this.$api.khxxaq
        .getSenRankData({
          prvdId: this.prvdId,
          audTrm: this.audTrm,
          concern: this.concern,
          flagId: this.flagId
        })
        .then(res => {
          // 表格数据初始化
          this.tableData = res.tableData;
        })
        .catch(err => {
          this.$message.error(err);
        });
      this.logRecord(
        "审计专题",
        "客户信息安全管理违规",
        "涉敏操作管理违规情况统计表",
        "查询"
      );
    },
    formatRn(state) {
      return state.rn === 0 ? "-" : state.rn;
    }
  }
};
</script>
<style lang="scss" scoped>
.rank-chest-table {
  /deep/.el-table th.gutter {
    display: block !important;
    width: 17px !important;
  }
}
.table-title {
  text-align: center;
  display: block;
  color: #fff;
  font-size: 16px;
  margin-bottom: 10px;
}
</style>


